package com.jy.project.controller;

import com.jy.project.dto.LoginDTO;
import com.jy.project.dto.UserDTO;
import com.jy.project.dto.UserQueryDTO;
import com.jy.project.service.LoginService;
import com.jy.project.service.UserService;
import com.jy.project.util.ServiceResultUtils;
import com.jy.project.vo.LoginVO;
import com.jy.project.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("")
@CrossOrigin
public class LoginController {

    @Autowired
    private LoginService loginService;

    /**
     * 用户登入
     * */
    @RequestMapping("/login")
    @ResponseBody
    public Object insertUserDTO(@Validated  LoginDTO dto){
        LoginVO login = loginService.login(dto);
        return ServiceResultUtils.success(login);
    }



}
